package com.project.role;

import com.project.frame.GameStartFrame;

import java.awt.*;
import java.util.List;


/**
 * 女孩子弹类
 */
public class GirlBullet extends BaseRole {
    public static Image girlBulletImg;

    public GirlBullet() {

        super(GameStartFrame.girl.x + 40, GameStartFrame.girl.y, 40, 15, 1);
        this.img = GirlBullet.girlBulletImg;
    }

    @Override
    public void move() {
        this.x += 15;
    }

    @Override
    public void collision() {
        if (this.rect.intersects(GameStartFrame.boss.rect)) {
            this.hp = 0;
            GameStartFrame.boss.hp -= GameStartFrame.boss.width / 50;
        }
        if (this.rect.intersects(GameStartFrame.dogMachine.rect)) {
            this.hp = -1;
            GameStartFrame.dogMachine.hp -= GameStartFrame.dogMachine.width / 10;
        }

    }

}
